import request from '@/utils/request'

// 封装获取文章列表接口
export const getArticleList = (obj) => {
  return request.get('/admin/interview/query', {
    params: {
      current: obj.current, // 当前是第几页
      pageSize: obj.pageSize // 每页多少条
    }
  })
}

// 封装添加面经文章接口
export const addArticle = (obj) => {
  return request.post('/admin/interview/create', obj)
}

// 封装删除面经文章接口
export const removeArticle = id => {
  return request.delete('/admin/interview/remove', {
    data: {
      id
    }
  })
}

// 封装获取文章详情接口
export const getArticleDetail = (id) => {
  return request.get('/admin/interview/show', {
    params: { id }
  })
}

// 封装修改面经文章接口
export const editArticle = obj => {
  return request.put('/admin/interview/update', obj)
}
